import sys
import os
from subprocess import *
svmscale_exe = "../svm-scale"
svmtrain_exe = "../svm-train"
svmpredict_exe = "../svm-predict"
grid_py = "./grid.py"
gnuplot_exe = "/usr/bin/gnuplot"

assert os.path.exists(svmscale_exe),"svm-scale executable not found"
assert os.path.exists(svmtrain_exe),"svm-train executable not found"
assert os.path.exists(svmpredict_exe),"svm-predict executable not found"
assert os.path.exists(gnuplot_exe),"gnuplot executable not found"
assert os.path.exists(grid_py),"grid.py not found"

cmd = 'python ./easy.py stoplossLong.svm stoplossLong.svm'
print 'stoplossLong...'
call(cmd, shell = True)

cmd = 'python ./easy.py stoplossShort.svm stoplossShort.svm'
print 'stoplossShort...'
call(cmd, shell = True)

cmd = 'python ./easy.py stopprofitLong.svm stopprofitLong.svm'
print 'stopprofitLong...'
call(cmd, shell = True)

cmd = 'python ./easy.py stopprofitShort.svm stopprofitShort.svm'
print 'stopprofitShort...'
call(cmd, shell = True)

cmd = 'python ./easy.py trendReverseLong.svm trendReverseLong.svm'
print 'trendReverseLong.svm...'
call(cmd, shell = True)

cmd = 'python ./easy.py trendReverseShort.svm trendReverseShort.svm'
print 'trendReverseShort.svm...'
call(cmd, shell = True)


